/**
 * Project Name:scapp-web
 * File Name:HouseController.java
 * Package Name:com.sc.controller
 * Date:2018年7月4日下午2:33:18
 * Copyright (c) 2018, bluemobi All Rights Reserved.
 */

package com.sc.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.sc.pojo.House;
import com.sc.service.HouseService;

/**
 * Description: <br/>
 * Date: 2018年7月4日 下午2:33:18 <br/>
 * 
 * @author liutao
 * @version
 * @see
 */
@Controller
public class HouseController {
    @Autowired
    private HouseService houseService;

    @RequestMapping("/show")
    @ResponseBody
    public List<House> show(int id) {

        List<House> list = houseService.selectItemsAndHouseAndDesigntype(id);
        System.out.println(list.size());
        return list;

    }

    @RequestMapping("/anchanginfo")
    public String checkAnChangInfo(int id, Model model) {
        System.out.println("获取id:" + id);
        List<House> list = houseService.selectItemsAndHouseAndDesigntype(id);
        for (House house : list) {
            System.out.println(list);
        }
        model.addAttribute("list", list);

        return "sc-anchanginfo";

    }

    /*
     * @RequestMapping("/page")
     * 
     * @ResponseBody public List<House> page(int id, int currentpage, int
     * pagesize) { PageBean pageBean = new PageBean();
     * pageBean.setSumpage(houseService
     * .selectItemsAndHouseAndDesigntype(id).size()); return null;
     * 
     * }
     */

}
